package com.easybbs;

import com.easybbs.service.SysSettingService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@Slf4j
public class InitRun implements ApplicationRunner {

    @Resource
    private SysSettingService sysSettingService;

    // 服务启动时会调用这个方法
    @Override
    public void run(ApplicationArguments args) throws Exception {
        // 刷新系统设置缓存
        sysSettingService.refreshCache();

        log.info("访客端 服务启动成功，开始愉快的开发吧！");
    }
}
